﻿using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace AJWPFAdmin.Services.Migrations
{
    /// <inheritdoc />
    public partial class 系统用户表新增表列配置字段 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<string>(
                name: "TableColumnsConfig",
                table: "SystemUsers",
                type: "longtext",
                nullable: true,
                comment: "列表页列配置")
                .Annotation("MySql:CharSet", "utf8mb4");

            migrationBuilder.AlterColumn<DateTime>(
                name: "RowVersionTimestamp",
                table: "SystemConfigDictionaries",
                type: "timestamp(6)",
                rowVersion: true,
                nullable: true,
                oldClrType: typeof(DateTime),
                oldType: "timestamp(6)",
                oldRowVersion: true,
                oldNullable: true)
                .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn);

            migrationBuilder.UpdateData(
                table: "CarTypes",
                keyColumn: "Id",
                keyValue: 480306L,
                column: "CreateDate",
                value: new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(5749));

            migrationBuilder.UpdateData(
                table: "CarTypes",
                keyColumn: "Id",
                keyValue: 480307L,
                column: "CreateDate",
                value: new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(5749));

            migrationBuilder.UpdateData(
                table: "CarTypes",
                keyColumn: "Id",
                keyValue: 480308L,
                column: "CreateDate",
                value: new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(5749));

            migrationBuilder.UpdateData(
                table: "CarTypes",
                keyColumn: "Id",
                keyValue: 480309L,
                column: "CreateDate",
                value: new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(5749));

            migrationBuilder.UpdateData(
                table: "CarTypes",
                keyColumn: "Id",
                keyValue: 480310L,
                column: "CreateDate",
                value: new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(5749));

            migrationBuilder.UpdateData(
                table: "CarTypes",
                keyColumn: "Id",
                keyValue: 480311L,
                column: "CreateDate",
                value: new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(5749));

            migrationBuilder.UpdateData(
                table: "PlatformCustomers",
                keyColumn: "Id",
                keyValue: 480306,
                columns: new[] { "CreateDate", "ExpireDate" },
                values: new object[] { new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(5749), new DateTime(2025, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(5749) });

            migrationBuilder.UpdateData(
                table: "SystemConfigDictionaries",
                keyColumn: "Key",
                keyValue: (short)6,
                column: "CreateDate",
                value: new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(5749));

            migrationBuilder.UpdateData(
                table: "SystemConfigDictionaries",
                keyColumn: "Key",
                keyValue: (short)1000,
                column: "CreateDate",
                value: new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(5749));

            migrationBuilder.UpdateData(
                table: "SystemConfigDictionaries",
                keyColumn: "Key",
                keyValue: (short)1001,
                column: "CreateDate",
                value: new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(5749));

            migrationBuilder.UpdateData(
                table: "SystemConfigDictionaries",
                keyColumn: "Key",
                keyValue: (short)1002,
                column: "CreateDate",
                value: new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(5749));

            migrationBuilder.UpdateData(
                table: "SystemDictionaries",
                keyColumn: "Id",
                keyValue: 1L,
                column: "CreateDate",
                value: new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(7964));

            migrationBuilder.UpdateData(
                table: "SystemDictionaries",
                keyColumn: "Id",
                keyValue: 2L,
                column: "CreateDate",
                value: new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(7983));

            migrationBuilder.UpdateData(
                table: "SystemDictionaries",
                keyColumn: "Id",
                keyValue: 3L,
                column: "CreateDate",
                value: new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(7993));

            migrationBuilder.UpdateData(
                table: "SystemRoles",
                keyColumn: "Id",
                keyValue: 480306L,
                columns: new[] { "CreateDate", "UpdateDate" },
                values: new object[] { new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(5749), new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(5749) });

            migrationBuilder.UpdateData(
                table: "SystemUsers",
                keyColumn: "Id",
                keyValue: 480306L,
                columns: new[] { "CreateDate", "TableColumnsConfig", "UpdateDate" },
                values: new object[] { new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(5749), null, new DateTime(2024, 9, 11, 20, 0, 52, 39, DateTimeKind.Local).AddTicks(5749) });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "TableColumnsConfig",
                table: "SystemUsers");

            migrationBuilder.AlterColumn<DateTime>(
                name: "RowVersionTimestamp",
                table: "SystemConfigDictionaries",
                type: "timestamp(6)",
                rowVersion: true,
                nullable: true,
                oldClrType: typeof(DateTime),
                oldType: "timestamp(6)",
                oldRowVersion: true,
                oldNullable: true)
                .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.ComputedColumn);

            migrationBuilder.UpdateData(
                table: "CarTypes",
                keyColumn: "Id",
                keyValue: 480306L,
                column: "CreateDate",
                value: new DateTime(2024, 9, 9, 16, 16, 31, 408, DateTimeKind.Local).AddTicks(7187));

            migrationBuilder.UpdateData(
                table: "CarTypes",
                keyColumn: "Id",
                keyValue: 480307L,
                column: "CreateDate",
                value: new DateTime(2024, 9, 9, 16, 16, 31, 408, DateTimeKind.Local).AddTicks(7187));

            migrationBuilder.UpdateData(
                table: "CarTypes",
                keyColumn: "Id",
                keyValue: 480308L,
                column: "CreateDate",
                value: new DateTime(2024, 9, 9, 16, 16, 31, 408, DateTimeKind.Local).AddTicks(7187));

            migrationBuilder.UpdateData(
                table: "CarTypes",
                keyColumn: "Id",
                keyValue: 480309L,
                column: "CreateDate",
                value: new DateTime(2024, 9, 9, 16, 16, 31, 408, DateTimeKind.Local).AddTicks(7187));

            migrationBuilder.UpdateData(
                table: "CarTypes",
                keyColumn: "Id",
                keyValue: 480310L,
                column: "CreateDate",
                value: new DateTime(2024, 9, 9, 16, 16, 31, 408, DateTimeKind.Local).AddTicks(7187));

            migrationBuilder.UpdateData(
                table: "CarTypes",
                keyColumn: "Id",
                keyValue: 480311L,
                column: "CreateDate",
                value: new DateTime(2024, 9, 9, 16, 16, 31, 408, DateTimeKind.Local).AddTicks(7187));

            migrationBuilder.UpdateData(
                table: "PlatformCustomers",
                keyColumn: "Id",
                keyValue: 480306,
                columns: new[] { "CreateDate", "ExpireDate" },
                values: new object[] { new DateTime(2024, 9, 9, 16, 16, 31, 408, DateTimeKind.Local).AddTicks(7187), new DateTime(2025, 9, 9, 16, 16, 31, 408, DateTimeKind.Local).AddTicks(7187) });

            migrationBuilder.UpdateData(
                table: "SystemConfigDictionaries",
                keyColumn: "Key",
                keyValue: (short)6,
                column: "CreateDate",
                value: new DateTime(2024, 9, 9, 16, 16, 31, 408, DateTimeKind.Local).AddTicks(7187));

            migrationBuilder.UpdateData(
                table: "SystemConfigDictionaries",
                keyColumn: "Key",
                keyValue: (short)1000,
                column: "CreateDate",
                value: new DateTime(2024, 9, 9, 16, 16, 31, 408, DateTimeKind.Local).AddTicks(7187));

            migrationBuilder.UpdateData(
                table: "SystemConfigDictionaries",
                keyColumn: "Key",
                keyValue: (short)1001,
                column: "CreateDate",
                value: new DateTime(2024, 9, 9, 16, 16, 31, 408, DateTimeKind.Local).AddTicks(7187));

            migrationBuilder.UpdateData(
                table: "SystemConfigDictionaries",
                keyColumn: "Key",
                keyValue: (short)1002,
                column: "CreateDate",
                value: new DateTime(2024, 9, 9, 16, 16, 31, 408, DateTimeKind.Local).AddTicks(7187));

            migrationBuilder.UpdateData(
                table: "SystemDictionaries",
                keyColumn: "Id",
                keyValue: 1L,
                column: "CreateDate",
                value: new DateTime(2024, 9, 9, 16, 16, 31, 408, DateTimeKind.Local).AddTicks(9313));

            migrationBuilder.UpdateData(
                table: "SystemDictionaries",
                keyColumn: "Id",
                keyValue: 2L,
                column: "CreateDate",
                value: new DateTime(2024, 9, 9, 16, 16, 31, 408, DateTimeKind.Local).AddTicks(9331));

            migrationBuilder.UpdateData(
                table: "SystemDictionaries",
                keyColumn: "Id",
                keyValue: 3L,
                column: "CreateDate",
                value: new DateTime(2024, 9, 9, 16, 16, 31, 408, DateTimeKind.Local).AddTicks(9342));

            migrationBuilder.UpdateData(
                table: "SystemRoles",
                keyColumn: "Id",
                keyValue: 480306L,
                columns: new[] { "CreateDate", "UpdateDate" },
                values: new object[] { new DateTime(2024, 9, 9, 16, 16, 31, 408, DateTimeKind.Local).AddTicks(7187), new DateTime(2024, 9, 9, 16, 16, 31, 408, DateTimeKind.Local).AddTicks(7187) });

            migrationBuilder.UpdateData(
                table: "SystemUsers",
                keyColumn: "Id",
                keyValue: 480306L,
                columns: new[] { "CreateDate", "UpdateDate" },
                values: new object[] { new DateTime(2024, 9, 9, 16, 16, 31, 408, DateTimeKind.Local).AddTicks(7187), new DateTime(2024, 9, 9, 16, 16, 31, 408, DateTimeKind.Local).AddTicks(7187) });
        }
    }
}
